package cn.timeapi.Applet.Mall.CatSquare.config;

import cn.timeapi.Applet.Mall.CatSquare.common.HandlerInterceptorAdapter.CheckParamsInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @description:
 * @author: Vincent Vic
 * @email: vincent-vic@qq.com
 * @time: 2020/9/30 16:46
 */

@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    CheckParamsInterceptor checkSourceInterceptor = new CheckParamsInterceptor();
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //如果除了接口的请求还有其他请求的话可以在所有的接口前面加个前缀区分开
        registry.addInterceptor(checkSourceInterceptor).addPathPatterns("/**");
    }
}
